package blackhouse_dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import blackhouse_entity.ResultBean;
import blackhouse_entity.student;
import blackhouse_entity.teacher;

public class readteacher_dao extends jdbc_dao{
	public List<teacher> show_teacher(String sql)
			throws SQLException
	{
		List<teacher> list = new ArrayList<teacher>();
		ResultSet RS = query(sql);
		while (RS.next())
		{
			teacher teaacherinfo = new teacher();
			teaacherinfo.setId(Integer.parseInt(RS.getString("id")));
			teaacherinfo.settName(RS.getString("tName"));
			list.add(teaacherinfo);
			
		}

		close(conn,st,RS);
		return list;
	}

	public int addteacher_dao(String sql) throws SQLException{
		return update(sql);
	}


	public int changeinfo(String sql)
	{
		int num = update(sql);
		return num;
	}

	public boolean addStudentInfo(String sql, List<Object> list)
			throws SQLException
	{
		return execute_Proc(sql, list);
	}
}
